/**   
 * Copyright © 2018 eSunny Info. Tech Ltd. All rights reserved.
 * 
 * @Package: com.wxsoft.java.demo 
 * @author: chenliang   
 * @date: 2018年6月22日 下午6:56:19 
 */
package com.wxsoft.java.demo;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;

/**
 * @author chenliang
 *
 */
public class Test {

	static Logger log = Logger.getLogger(Test.class);
	
	volatile int [] a = new int[5];

	public final static native int w();
	
	
	static int  i ; 
	public static void main(String[] s) throws ClassNotFoundException {
		testInteger();
	}
	
	public static void testInteger() throws ClassNotFoundException{
		Integer i = new Integer(0);
		i.intValue();
		
//		Class ci1 = Class.forName("java.long.Integer");
		
		Class ci = i.getClass();
		//方法。属性
		Method[] methods = ci.getMethods();
		for( Method method : methods){
			System.out.println(method.getName());
		}
		System.out.println("---------------");
		
		Class ci2 = Integer.TYPE;
		Method[] methods2 = ci2.getMethods();
		for( Method method : methods2){
			System.out.println(method.getName());
		}
	}

	public static void testString(){
		String s = "   asdfasdfadsddf  ";
		System.out.println(s.substring(1));
		System.out.println(s.substring(2, 3));
		System.out.println(s.trim());
		Class<? extends String> class1 = s.getClass();
	}
	public static void testEquals(){
		
		Map<String, String> m = new HashMap<String, String>();
		Map<String, String> m2 = null;
		m.put("s", null);
		if(m.equals(m2)){
			System.out.println("map xiangdeng ");
		}
		System.out.println("map bu xiangdeng ");
		
		
	}
	public static void test(){
try {
			
			Counter a = new Counter();
			System.out.println(a.inerement());
			System.out.println(a.anotherincrement());
			Counter b = new Counter();
			System.out.println(b.inerement());
			
			System.out.println("a"+100%3+100);
			
			System.out.println(i);
			Map<String, String> m = new HashMap<String, String>();
			m.put("", "");
			test1();
			System.out.println("abc");
			throw new RuntimeException("log.error(e,e);");
		} catch (Exception e) {
			log.error(e, e);
		}

	}

	public static void test1() {
		String s1 = "zifuchuan";
		String s2 = new String("zifuchuan");
		String s3 = "zifu" + "chuan";
		try{
		System.out.println(s1 == s2);
		System.out.println(s1 == s3);
		System.out.println(s1 == s1.intern());
		}catch(NullPointerException w){
			
		}

	}

}
